#pragma once
#include <QWidget>

class LoginProgressBtn :
    public QWidget
{
    enum class State
    {
        Normal,
        Hover,
        Pressed
    };
    Q_OBJECT
public:
    LoginProgressBtn(QWidget* parent = nullptr);
    void setLoginProgress(int v);
    void setLoginState(bool logining);

Q_SIGNALS:
    void clicked();
protected:
    virtual void paintEvent(QPaintEvent* event) override;
    virtual void mousePressEvent(QMouseEvent* event) override;
    virtual void mouseReleaseEvent(QMouseEvent* event) override;
    virtual void enterEvent(QEvent* event) override;
    virtual void leaveEvent(QEvent* event) override;

private:
    int     m_progress = 0;
    bool    m_logining = false;
    State   m_state = State::Normal;
};